Skip to content

fix: ignore autoplay attribute mutations regardless of tagName case - #1921

Merged
Juice10 merged 1 commit into
rrweb-io:mainfrom
roggernaut:fix/ignore-attribute-tagname-case
Sep 8, 2026
Merged

fix: ignore autoplay attribute mutations regardless of tagName case#1921
Juice10 merged 1 commit into
rrweb-io:mainfrom
roggernaut:fix/ignore-attribute-tagname-case

Conversation

@roggernaut

Copy link
Copy Markdown
Contributor

Fixes #1916.

ignoreAttribute compares the tag name against lowercase ['video', 'audio'], but the attribute-mutation handler in packages/rrweb/src/record/mutation.ts passes the native uppercase target.tagName, so autoplay changes on media elements were never ignored during live recording. This lowercases the tag name inside ignoreAttribute, making the snapshot and mutation paths behave the same.

Includes unit tests (the uppercase case fails without the fix) and a changeset.

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 092f54b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
rrweb-snapshot Patch
rrweb Patch
@rrweb/all Patch
@rrweb/browser-client Patch
@rrweb/packer Patch
@rrweb/record Patch
@rrweb/replay Patch
rrdom-nodejs Patch
rrdom Patch
rrvideo Patch
rrweb-player Patch
@rrweb/types Patch
@rrweb/utils Patch
@rrweb/web-extension Patch
@rrweb/rrweb-plugin-canvas-webrtc-record Patch
@rrweb/rrweb-plugin-canvas-webrtc-replay Patch
@rrweb/rrweb-plugin-console-record Patch
@rrweb/rrweb-plugin-console-replay Patch
@rrweb/rrweb-plugin-network-record Patch
@rrweb/rrweb-plugin-network-replay Patch
@rrweb/rrweb-plugin-sequential-id-record Patch
@rrweb/rrweb-plugin-sequential-id-replay Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@roggernaut
roggernaut force-pushed the fix/ignore-attribute-tagname-case branch 3 times, most recently from 1880d47 to 3e96bc7 Compare September 8, 2026 09:33
ignoreAttribute compared the tag name against lowercase literals, but the
attribute-mutation handler in rrweb passed the native uppercase
target.tagName, so autoplay changes on video/audio elements were never
ignored during live recording. Lowercase target.tagName once in the
attribute-mutation handler and reuse it for the ignoreAttribute,
transformAttribute, iframe and input checks. ignoreAttribute now takes an
already-lowercased tag name and lowercases the attribute name too, so
AUTOPLAY is matched as well.

Fixes rrweb-io#1916

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Changes

Size change: +1.08 kB (+0.01%) | Total size: 10426.39 kB

all - 1975.18 kB -> 1975.43 kB (+265 B (+0.01%))
File Base PR Diff
all.cjs 567.74 kB 567.83 kB +88 B (+0.02%)
all.js 567.41 kB 567.50 kB +88 B (+0.02%)
all.umd.cjs 570.95 kB 571.04 kB +88 B (+0.02%)
all.umd.min.cjs 269.07 kB 269.07 kB +1 B (+0.00%)
browser-client - 669.93 kB -> 670.07 kB (+140 B (+0.02%))
File Base PR Diff
browser-client.cjs 192.10 kB 192.15 kB +52 B (+0.03%)
browser-client.js 191.87 kB 191.92 kB +52 B (+0.03%)
browser-client.umd.cjs 194.92 kB 194.97 kB +52 B (+0.03%)
browser-client.umd.min.cjs 91.05 kB 91.03 kB -16 B (-0.02%)
record - 552.55 kB -> 552.68 kB (+140 B (+0.02%))
File Base PR Diff
record.cjs 158.41 kB 158.46 kB +52 B (+0.03%)
record.js 158.32 kB 158.38 kB +52 B (+0.03%)
record.umd.cjs 159.74 kB 159.79 kB +52 B (+0.03%)
record.umd.min.cjs 76.07 kB 76.05 kB -16 B (-0.02%)
replay - 1406.98 kB -> 1407.10 kB (+125 B (+0.01%))
File Base PR Diff
replay.cjs 403.80 kB 403.84 kB +36 B (+0.01%)
replay.js 403.71 kB 403.75 kB +36 B (+0.01%)
replay.umd.cjs 406.78 kB 406.82 kB +36 B (+0.01%)
replay.umd.min.cjs 192.69 kB 192.70 kB +17 B (+0.01%)
rrweb - 1913.36 kB -> 1913.62 kB (+265 B (+0.01%))
File Base PR Diff
rrweb.cjs 550.91 kB 550.99 kB +88 B (+0.02%)
rrweb.js 550.60 kB 550.69 kB +88 B (+0.02%)
rrweb.umd.cjs 552.12 kB 552.21 kB +88 B (+0.02%)
rrweb.umd.min.cjs 259.72 kB 259.73 kB +1 B (+0.00%)
rrweb-player - 1643.75 kB -> 1643.88 kB (+132 B (+0.01%))
File Base PR Diff
rrweb-player.cjs 473.33 kB 473.37 kB +38 B (+0.01%)
rrweb-player.js 473.21 kB 473.24 kB +38 B (+0.01%)
rrweb-player.umd.cjs 476.12 kB 476.16 kB +38 B (+0.01%)
rrweb-player.umd.min.cjs 221.09 kB 221.11 kB +18 B (+0.01%)
rrweb-snapshot - 609.57 kB -> 609.61 kB (+42 B (+0.01%))
File Base PR Diff
rrweb-snapshot.cjs 175.01 kB 175.03 kB +13 B (+0.01%)
rrweb-snapshot.js 174.07 kB 174.08 kB +13 B (+0.01%)
rrweb-snapshot.umd.cjs 177.48 kB 177.50 kB +13 B (+0.01%)
rrweb-snapshot.umd.min.cjs 83.00 kB 83.00 kB +3 B (+0.00%)

@Juice10
Juice10 merged commit 7b10fba into rrweb-io:main Sep 8, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ignoreAttribute never matches on the attribute-mutation path (tagName case mismatch)

2 participants